Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

263
Visualizações
header("Location:") function doesn't work on live server

I've developed my website on localhost, and I upload all the files on the server now. Unfortunately, when I go to the account page while I'm not connected, the redirection using the header('Location: /login') function isn't working. I've tried many solutions, like using the function ob_start() and ob_end_flush(), but it still doesn't work. I've also tried to change the paths, without any good results.

account.php

logged_only();
require 'includes/needed.php';

// ...

logged_only() function

function logged_only()
{
    if (!isset($_SESSION['auth'])) {
        header('Location: /login');
        exit();
    }
}

Hope you can help me

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda